home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 139 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.7 KB

  1. Path: fido.asd.sgi.com!austern
  2. From: David Chase <chase@centerline.com>
  3. Newsgroups: comp.std.c++
  4. Subject: Re: Throwing an exception from within a si
  5. Date: 25 Jan 1996 09:07:54 PST
  6. Organization: -
  7. Approved: austern@isolde.mti.sgi.com
  8. Message-ID: <9601250226.AA04101@vajra>
  9. NNTP-Posting-Host: isolde.mti.sgi.com
  10. X-Original-Date: Wed, 24 Jan 96 21:26:27 EST
  11. In-Reply-To: Message of Wed, 24 Jan 1996 18:11:23 -0700
  12.     from wclodius@lanl.gov (WIlliam B. Clodius)
  13.     <199601250105.SAA08631@sstcx1.lanl.gov>
  14. X-Auth: PGPMoose V1.1 PGP comp.std.c++
  15.     iQBVAwUBMQe5Lky4NqrwXLNJAQHQfAIAqTrW7WuSA8mrewXmrrhcN7nnCRuby3t3
  16.     FOHhnslrVrtjz8gcs/zFFD3xw+gKHJJLQh/F0wNgb4oenkwSaTjQ1w==
  17.     =HnJn
  18. Originator: austern@isolde.mti.sgi.com
  19.  
  20. > Note in the discussion of handlers for asynchronous exception no reference
  21. > has been made to existing implementations.  I believe Eiffel, and to a
  22. > much lesser extent, Ada, have asynchronous exception handling, and have
  23. > not suffered a significant performance degradation by the inclusion of
  24. > this capability in the language.  Am I correct in my belief, and do other
  25. > languages have such capabilities?
  26.  
  27. I think this depends on how you define "significant".  Dealing with
  28. asynchronous exception handling in the formal data-flow-analysis 
  29. sense, it really trashes your flow graph.  That should make your 
  30. compilation take longer, and the result should be somewhat slower.
  31. However, I'm not sure that "somewhat" exceeds 10%, most of the time.
  32.  
  33. As for other languages with async exception handling, I'm pretty
  34. sure that the Acorn Modula-2+ compiler supported it, and it generated
  35. code that was clean and efficient by the standards of its time (1988).
  36. I'm pretty sure that the DEC-SRC M-2+ compiler also supported it, 
  37. and some of that technology may have made it back into the DEC binary 
  38. interfaces.
  39.  
  40. Oddly enough, I think you can "code to the compiler" with (asynchronous) 
  41. exception handling.  If, in your exception handler, you overwrite 
  42. every single variable that was set in your code (and perhaps visible 
  43. outside the exception handler) and if your flow analysis is looking 
  44. for this trick, then the compiler should generate code that is just 
  45. fine -- since all the exception kills all the values anyway, you 
  46. don't have to stand on your head in the unexceptional case to preserve 
  47. them for the case where control flows into the handler -- that is, 
  48. you can optimize them (there's an interesting dual to control-flow 
  49. here that I really ought to think about a little harder).
  50.  
  51. David
  52. ---
  53. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  54.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy
  55.   is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
  56.